home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / a7221v1b.zip / ADI7221 / HPPARMS.H < prev    next >
Text File  |  1992-03-12  |  2KB  |  68 lines

  1. /*
  2.    Module:  hpparms.h
  3.    Date:    3/9/92
  4.    Version: 1.0b
  5.    Author:  Dave Lutz
  6.    Email:   lutz@psych.rochester.edu
  7.    Copyright: 1992 University of Rochester, Psychology Dept.
  8.  
  9.    Disclaimer:  This software is distributed free of charge.  As such, it
  10.                 comes with ABSOLUTELY NO WARRANTY.  The user of the software
  11.                 assumes ALL RISKS associated with its use.
  12.  
  13.                 Your rights to modify and/or distribute this software are
  14.                 outlined in the file ADI7221.DOC.
  15.  
  16.    Purpose: This module provides the function prototupes for the functions 
  17.             required to convert ADI code arguments to HP parameter codes.
  18.  
  19.    Functions provided:
  20.  
  21.         uinttosbn    (unsigned int to Single Byte Number)
  22.         uiptombp     (unsigned int pair to Multiple Byte Pair)
  23. */
  24.  
  25. #define MAXMBPLEN 5  /* maximum length of a Multiple Byte Pair */
  26.  
  27. /*
  28.    Function: uinttosbn
  29.    Purpose:  Convert an unsigned int to an HP Single Byte Number.
  30.  
  31.    Pre: numin is the number to convert.
  32.         0 <= numin <= 63
  33.         sbnout is a pointer to storage for the converted Single Byte Number.
  34.  
  35.    Post: An attempt is made to convert numin to SBN format and copy the
  36.          retult to sbnout.
  37.          If an error occurs (ie numin is out of range), FALSE is returned.
  38.          Otherwise, TRUE is returned.
  39. */
  40.  
  41. int uinttosbn (unsigned numin, char *sbnout);
  42.  
  43.  
  44.  
  45. /*
  46.    Function: uiptombp
  47.    Purpose: Convert a pair of unsigned ints to an HP Multiple Byte Pair.
  48.  
  49.    Pre: num1 and num2 comprise the pair of numbers to be converted to an
  50.         HP MBP.
  51.         0 <= num1,num2 <= 16383
  52.         mbpout is a pointer to storage for the converted code.
  53.         mbpout points to enough storage to hold the maximum size of a mbp
  54.         formatted code (MAXMBPLEN).
  55.         mbpsize is a pointer to storage for the number of bytes actually
  56.         placed in mbpout.
  57.  
  58.    Post: an attempt is made to convert num1 and num2 to MBP format and copy
  59.          the result to mbpout.
  60.          The number of bytes in mbpout is returned in mbpsize.
  61.          If an error occurs (num1 or num2 are out of range), FALSE is
  62.          returned.
  63.          Otherwise, TRUE is returned.
  64.  
  65. */
  66.  
  67. int uiptombp (unsigned num1, unsigned num2, char *mbpout, int *mbpsize);
  68.